<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/app.css"/>
		<link rel="stylesheet" type="text/css" href="css/my_order.css" />
		<link rel="stylesheet" type="text/css" href="css/public.css" />
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style type="text/css">
			.mui-content{margin-bottom: 0px!important;}
			.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
				color: #5763FF;
			}

			.mui-table-view a{display: block;}
			.mui-content{margin-top: 45px!important;}
			.btnStyle{margin: 10px 0;}
			.pwd-box {
				width: 100%;
				height: 40px;
				position: relative;
				border: 1px solid #9f9fa0;
				border-radius: 3px;
				overflow: hidden;
				margin: 10px auto;
			}
			
			.pwd-box input[type="number"] {
				width: 100%;
				height: 100%;
				/*color: transparent;  */
				/*letter-spacing 属性增加或减少字符间的空白*/
				/*letter-spacing: 35px;*/
				position: absolute;
				top: 0;
				left: 0;
				border: none;
				font-size: 18px;
				opacity: 0;
				z-index: 1;
				outline: none;
			}
			
			.fake-box {
				width: 100%;
				height: 100%;
				display: flex;
				flex-flow: row;
			}
			
			.fake-box input {
				flex: 1;
				width: 100%;
				height: 100%;
				border: none;
				border-right: 1px solid #e5e5e5;
				text-align: center;
				font-size: 30px;
				float: left;
			}
			
			.fake-box input:nth-last-child(1) {
				border: none;
			}
			
			.offBtn {
				background: none;
				width: initial;
				display: inline;
				float: left;
				font-size: 24px;
				color: #000000;
				top: -15px;
				width: initial;
				padding: 0;
			}

			
			.mui-popup-inner {
				border-radius: 13px 13px 0px 0px;
				padding: 25px;
			}
			
			.mui-popup-text input {
				padding: 0;
			}
			.mui-slider-indicator.mui-segmented-control{position: fixed!important;z-index: 10;background: white;top: 45px;}
			.mui-slider-progress-bar{z-index:10!important;position: fixed;top:83px;left: 0;}
			.mui-segmented-control .mui-control-item.mui-active{background-color:rgba(0,0,0,0)!important;color:#5763FF!important;}
			 .mui-segmented-control .mui-control-item{border: none;color: #000000;}
			 .mui-table-view:before{background: none!important;}
			 .mui-table-view:after{background: none!important;}
			 .mui-table-view li:after{background: none!important;}
		</style>
	</head>

	<body>
		<div id="headerNav"></div>
		<!--------收货地址----------->
		<div id="" class="mui-content">
			<div>
				<div class="mui-slider-indicator mui-segmented-control" style="border: none;">
					<a class="mui-control-item mui-active" href="#item1">全部订单</a>
					<a class="mui-control-item" >待付款</a>
					<a class="mui-control-item">待发货</a>
					<a class="mui-control-item">待收货</a>
					<a class="mui-control-item">已完成</a>
				</div>
				<div id="sliderProgressBar" class="mui-slider-progress-bar" style="width: 20%;background: #5763FF;"></div>
				<div class="mui-slider-group" style="position:relative;top:42px;margin-bottom: 50px;">
					<div  id="item1" class="mui-slider-item mui-control-content mui-active">
	
					</div>
					<div id="item2" class="mui-slider-item mui-control-content">
						
					</div>
					<div id="item3" class="mui-slider-item mui-control-content">
						
					</div>
					<div id="item4" class="mui-slider-item mui-control-content">
						
					</div>
					<div id="item5"  class="mui-slider-item mui-control-content">
						
					</div>
				</div>
			</div>
		</div>
		
		<nav class="mui-bar mui-bar-tab foot_nav">
			
		</nav>
	</body>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script type="text/javascript">
		
		$('#headerNav').load('header.html', function() {
			$('header h1').html('订单');
			$('header a').hide();
		});
		(function(){
			mui('.mui-slider-indicator').on('tap','a',function(){
				console.log(mui(this))
				$('.mui-slider-item').hide().removeClass('mui-active');
//				$('.mui-slider-item').hide();
				$('.mui-slider-item').eq($(this).index()).show();
				$('.mui-slider-item').eq($(this).index()).addClass('mui-active');
				var windowSreen=window.screen.width;
				var prewS=parseInt(windowSreen)/5;
				var trs=$(this).index();
				var trsd=trs*prewS+'px';
				$('#sliderProgressBar').css('transform','translate3d('+trsd+', 0px, 0px) translateZ(0px)')
			})
		})()
		mui('.mui-bar').on('tap', 'a', function() {
			window.top.location.href = this.href;
		})
		var a = localStorage.state;
		var b = localStorage.data;
		//	var status = b.Int();
		if(a == 1) {
			$.ajax({
				type: "post",
				url: "http://mall.itcn99.com/i/index/nav",
				dataType: "jsonp",
				async: true,
				//					jsonp: "callback",  //传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名,默认为callback
				//					jsonpCallback: "userHandler",  //自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名，也可以写"?"，jQuery会自动为你处理数据
				data: {

				},
				success: function(data) {
					//					console.log(data);
					var nav_url = data.data[0]["nav_url"];
					var nav_url1 = data.data[1]["nav_url"];
					var nav_url2 = data.data[2]["nav_url"];
					console.log
					var title = data.data[0]["title"];
					var title1 = data.data[1]["title"];
					var title2 = data.data[2]["title"];
					$(".foot_nav").html("").append('<a class="mui-tab-item" id="indexHtml" href="' + nav_url + '.html"><span class="mui-icon iconfont icon-iconfonthome0"></span><span class="mui-tab-label">' + title + '</span></a><a class="mui-tab-item mui-active" id="orderHtml" href="' + nav_url1 + '.html"><span class="mui-icon iconfont icon-dingdan"></span><span class="mui-tab-label">' + title1 + '</span></a><a class="mui-tab-item" id="myHtml" href="' + nav_url2 + '.html"><span class="mui-icon iconfont icon-weibiaoti-_huabanfuben"></span><span class="mui-tab-label">' + title2 + '</span></a>')
				}
			})
			//订单展示
			$.ajax({
				type: "post",
				url: "http://mall.itcn99.com/i/index/myorder",
				async: true,
				dataType: 'jsonp',
				data: {
					"uid": b,
					"status": 1
				},
				success: function(data) {
//					
					console.log(data)
					var state = data.data.length;

					var str = "";
					if(state <1) {
						$("#item1").html("").append('<div class="mui-card-content"><img src="image/icon_dingdan.png" style="width:40%;margin:0 auto;display: block;"/><div class="add_site">您还没有相关的订单</div><div class="mui-button-row" style="background:white;margin-top:14px;"><button type="button" class="mui-btn mui-btn-primary" style="width:60%;height:50px;background:#5763FF;" onclick="seeBtn()">去看看</button></div></div>')
					} else if(state >= 1) {
						var $this;
						for(var i = 0; i < data.data.length; i++) {
							if(data.data[i].state == 2){
								$this = "待付款";
								str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media" style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn" onclick="goPayBtn(this)">去支付</button> <button class="mui-btn data_oid" onclick="cancel(this)" data-oid="'+data.data[i].id+'">取消订单</button></div></li></ul>'
								
							}
							if(data.data[i].state == 3){
								$this = "待发货"
								str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media"  style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn data_oid"  onclick="warnGoods()"  data-oid="'+data.data[i].id+'">提醒发货</button></div></li></ul>'
							}                                                                                
							if(data.data[i].state == 4){                                                     
								$this = "待收货"                                                                
								str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media"  style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn data_oid" onclick="confirmGoods(this)" data-oid="'+data.data[i].id+'">确认收货</button></div></li></ul>'
							}                                                                                
							if(data.data[i].state == 5){                                                     
								$this = "已完成"                                                                
								str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media"  style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn data_oid" id="delOrdBtn" style="margin-right:10px;" onclick="delete_order(this)" data-oid="'+data.data[i].id+'">删除订单</button></div></li></ul>'
								var oid=data.data[i].id;
								console.log(oid)
							}
							if(data.data[i].state == 6){
								$this = "已失效"
								str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media" style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn data_oid" id="delOrdBtn" style="margin-right:10px;" onclick="del(this)" data-oid="'+data.data[i].id+'">删除订单</button></div></li></ul>'
								var oid=data.data[i].id;
								console.log(oid)
							}
							$("#item1").html("").append(str);
						}
					
						
					}
//					
				}
				
				
			});
				//代付款
					$.ajax({
						type: "post",
						url: "http://mall.itcn99.com/i/index/myorder",
						async: true,
						dataType: 'jsonp',
						data: {
							"uid": b,
							"status":2
						},
						success: function(data) {
							console.log(data)
							var state = data.data.length;
							var str = "";
							if(state <1 ) {
								$("#item2").html("").append('<div class="mui-card-content"><img src="image/icon_dingdan.png" style="width:40%;margin:0 auto;display: block;"/><div class="add_site">您还没有相关的订单</div><div class="mui-button-row" style="background:white;margin-top:14px;"><button type="button" class="mui-btn mui-btn-primary" style="width:60%;height:50px;background:#5763FF;" onclick="seeBtn()">去看看</button></div></div>')
							} else if(state >=1) {
								var $this;
								for(var i = 0; i < data.data.length; i++) {
									if(data.data[i].state == 2){
										$this = "待付款"
									}
									str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media" style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"> <button class="mui-btn"  onclick="goPayBtn(this)">去支付</button> <button class="mui-btn data_oid" onclick="cancel(this)" data-oid="'+data.data[i].id+'">取消订单</button></div></li></ul>'
									$("#item2").html("").append(str);
								}
							}
						}
					});
				//待发货
					$.ajax({
						type: "post",
						url: "http://mall.itcn99.com/i/index/myorder",
						async: true,
						dataType: 'jsonp',
						data: {
							"uid": b,
							"status": 3
						},
						success: function(data) {
							console.log(data)
							var state = data.data.length;
							var str = "";
							if(state < 1) {
								$("#item3").html("").append('<div class="mui-card-content"><img src="image/icon_dingdan.png" style="width:40%;margin:0 auto;display: block;"/><div class="add_site">您还没有相关的订单</div><div class="mui-button-row" style="background:white;margin-top:14px;"><button type="button" class="mui-btn mui-btn-primary" style="width:60%;height:50px;background:#5763FF;" onclick="seeBtn()">去看看</button></div></div>')
							} else if(state >=1) {
								var $this;
								for(var i = 0; i < data.data.length; i++) {
									if(data.data[i].state == 3){
										$this = "待发货"
									}
									str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media" style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn data_oid" onclick="warnGoods()"  data-oid="'+data.data[i].id+'">提醒发货</button></div></li></ul>'
									$("#item3").html("").append(str);
								}
							}
						}
					});
//					待收货
					$.ajax({
						type: "post",
						url: "http://mall.itcn99.com/i/index/myorder",
						async: true,
						dataType: 'jsonp',
						data: {
							"uid": b,
							"status": 4
						},
						success: function(data) {
							console.log(data)
							var state = data.data.length;
							var str = "";
							if(state < 1) {
								$("#item4").html("").append('<div class="mui-card-content"><img src="image/icon_dingdan.png" style="width:40%;margin:0 auto;display: block;"/><div class="add_site">您还没有相关的订单</div><div class="mui-button-row" style="background:white;margin-top:14px;"><button type="button" class="mui-btn mui-btn-primary" style="width:60%;height:50px;background:#5763FF;" onclick="seeBtn()">去看看</button></div></div>')
							} else if(state >=1) {
								var $this;
								var oid;
								for(var i = 0; i < data.data.length; i++) {
									if(data.data[i].state == 4){
										$this = "待收货"
										
									}
									str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media" style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn confirm data_oid" onclick="confirmGoods(this)"  data-oid="'+data.data[i].id+'">确认收货</button></div></li></ul>'
									$("#item4").html("").append(str);
								}
							}
						}
					});
					//已完成
					$.ajax({
						type: "post",
						url: "http://mall.itcn99.com/i/index/myorder",
						async: true,
						dataType: 'jsonp',
						data: {
							"uid": b,
							"status": 5
						},
						success: function(data) {
							console.log(data)
							var state = data.data.length;
							var str = "";
							if(state < 1) {
								$("#item5").html("").append('<div class="mui-card-content"><img src="image/icon_dingdan.png"  style="width:40%;margin:0 auto;display: block;"/><div class="add_site">您还没有相关的订单</div><div class="mui-button-row" style="background:white;margin-top:14px;"><button type="button" class="mui-btn mui-btn-primary" style="width:60%;height:50px;background:#5763FF;" onclick="seeBtn()">去看看</button></div></div>')
							} else if(state >=1) {
								var $this;
								for(var i = 0; i < data.data.length; i++) {
									if(data.data[i].state == 5){
										$this = "已完成"
									}
									str += '<ul class="mui-table-view"><li class="mui-table-view-cell mui-media" style="background:#f9f9f9;margin:15px 0;"><p style="overflow: hidden;margin: 10px 0;"></p><a onclick="btn(this)"><img class="mui-media-object mui-pull-left width90" src="' + data.data[i].img + '" style="width:90px;height:90px;margin:0 5px 0 0;max-width:90px;"><div class="mui-media-body"><p class="mui-ellipsis"><span class="mui-pull-left" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70%">' + data.data[i].name + '</span><span class="mui-pull-right" style="color: #ED7700;font-size: 14px;">'+$this+'</span></p><p class="mui-ellipsis" style="color: #999999;font-size: 14px;"><span>' + data.data[i].specific + '</span><span class="mui-pull-right">x'+data.data[i].math+'</span></p><p class="mui-pull-right total" style="margin: 20px 0 0 0;">共<span>' + data.data[i].math + '</span>件商品 合计:<span>￥' + data.data[i].allprice + '</span></p></div></a><div class="mui-btn-nav mui-pull-right btnStyle"><button class="mui-btn data_oid" id="delOrdBtn" style="margin-right:10px;" onclick="delete_order(this)" data-oid="'+data.data[i].id+'">删除订单</button></div></li></ul>'
									$("#item5").html("").append(str);
								}
							}
						}
					});
			
		} else {
			//项目底部导航接口
			$.ajax({
				type: "post",
				url: "http://mall.itcn99.com/i/index/nav",
				dataType: "jsonp",
				async: true,
				//					jsonp: "callback",  //传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名,默认为callback
				//					jsonpCallback: "userHandler",  //自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名，也可以写"?"，jQuery会自动为你处理数据
				data: {

				},
				success: function(data) {
					console.log(data);
					var nav_url = data.data[0]["nav_url"];
					var title = data.data[0]["title"];
					var title1 = data.data[1]["title"];
					var title2 = data.data[2]["title"];
					$(".foot_nav").html("").append('<a class="mui-tab-item mui-active" id="indexHtml" href="' + nav_url + '.html"><span class="mui-icon iconfont icon-iconfonthome0"></span><span class="mui-tab-label">' + title + '</span></a><a class="mui-tab-item" id="orderHtml" href="order_form.html"><span class="mui-icon iconfont icon-dingdan"></span><span class="mui-tab-label">' + title1 + '</span></a><a class="mui-tab-item" id="myHtml" href="register.html"><span class="mui-icon iconfont icon-weibiaoti-_huabanfuben"></span><span class="mui-tab-label">' + title2 + '</span></a>')
				}
			})
		}
		//确认收货
			function confirmGoods(e){
				var oid = $(e).attr("data-oid");
					$.ajax({
						type:"post",
						url:"http://mall.itcn99.com/i/index/order_Confirm",
						async:true,
						data:{
							'uid':b,
							"status": 4,
							'oid':oid
						},
						dataType:'jsonp',
						success:function(data){
							console.log(data)
							window.location.reload();
						}
					});
			}
			//提醒发货
			function warnGoods(){
				mui.alert('','提醒发货成功');
			}
			//取消订单
			function cancel(e){
				mui.confirm("","是否取消订单",function(a){
					if(a.index == 1){
						var oid = $(e).attr("data-oid");
						$.ajax({
							type:"post",
							url:"http://mall.itcn99.com/i/index/order_Cancel",
							async:true,
							data:{
								'uid':b,
								"status": 2,
								'oid':oid
							},
							dataType:'jsonp',
							success:function(data){
								console.log(data)
								var state = data.state
								if(state == 1){
									mui.alert("","取消成功",function(){
										window.location.reload();
									})
								
									
								}else if(state == 0){
									mui.alert("","该订单不可取消")
								}
							}
						});
					}
				})	
			}
			//删除订单
			function delete_order(e){
				mui.confirm("","是否删除订单",function(a){
					if(a.index == 1){
						var oid = $(e).attr("data-oid");
						$.ajax({
							type:"post",
							url:"http://mall.itcn99.com/i/index/order_del",
							async:true,
							data:{
								'uid':b,
								"status":5,
								'oid':oid
							},
							dataType:'jsonp',
							success:function(data){
								console.log(data)
								var state = data.state
								if(state == 1){
									mui.alert("","删除成功",function(){
										window.location.href="my_order.html"	
									})
									
								}else if(state == 0){
									mui.alert("","该订单不可删除")
								}
							}
						});
					}
				})
				
			}
			//删除失效订单
			function del(e){
				mui.confirm("","是否删除订单",function(a){
					if(a.index == 1){
						var oid = $(e).attr("data-oid");
						$.ajax({
							type:"post",
							url:"http://mall.itcn99.com/i/index/order_del",
							async:true,
							data:{
								'uid':b,
								"status":6,
								'oid':oid
							},
							dataType:'jsonp',
							success:function(data){
								console.log(data)
								var state = data.state
								if(state == 1){
									mui.alert("","删除成功",function(){
										window.location.href="my_order.html"	
									})
								}else if(state == 0){
									mui.alert("","该订单不可删除")
								}
							}
						});
					}
				})
			}
			//订单详情链接
			function btn(e){
				var oid=$(e).siblings('.btnStyle').find(".data_oid").attr("data-oid");
				console.log(oid);
				var states = $(e).find('p').eq(0).find('.mui-pull-right').html();
//				console.log(states)
				if(states=='待付款'){
					states=2
				}
				if(states=='待发货'){
					states=3
				}
				if(states=='待收货'){
					states=4
				}
				if(states=='已完成'){
					states=5
				}
				if(states=='已失效'){
					states=6
				}
				window.location.href="order_details.html?id="+oid+"&state="+states
//	console.log(states);
			}
				function seeBtn(){
					window.location.href="index.html"	
				}
			//去支付
			var innhtml = '<div class="pwd-box"><input type="number" maxlength="6" class="pwd-input" id="pwd-input" autofocus=""><div class="fake-box"><input type="password" readonly=""><input type="password" readonly=""><input type="password" readonly=""> <input type="password" readonly=""><input type="password" readonly=""><input type="password" readonly=""></div></div>'
			var titlePrice = '<p style="color:#333333;font-weight:blod;"><span class="mui-popup-button" onclick="offBtn()">×</span>请输入支付密码</p>' + '<p class="pay_moeny" style="color:#000000;font-weight:blod;font-size:24px;margin:20px 0;"></p>'
			var quereng='<span class="mui-popup-button mui-popup-button-bold" style="display:none;">确定</span>'
			
			function goPayBtn(e){
				var oid=$(e).siblings('button').attr("data-oid");
				var prices=$(e).parent('.btnStyle').siblings('a').find('.total').find('span').eq(1).html();
				console.log(prices);
				mui.alert(innhtml, '<p style="color:#333333;font-weight:blod;"><span class="mui-popup-button offBtn" onclick="offBtn()">×</span>请输入支付密码</p>' + '<p class="pay_moeny" style="color:#000000;font-weight:blod;font-size:24px;margin:20px 0;">' + prices + '</p>');
				$('.mui-popup-buttons').css('display','none');
				$("#pwd-input").on("input", function() {
									// trim(): 去两边空格的方法；

									var pwd = $(this).val().trim();
									for(var i = 0; i < pwd.length; i++) {
										$(".fake-box input").eq(i).val(pwd[i]);
									}
									$(".fake-box input").each(function() {
										var index = $(this).index();
										if(index >= pwd.length) {
											$(this).val("");
										}
									});
									if(pwd.length == 6) {
										$('.mui-popup-buttons').show();
										if($('.mui-popup').length>1){
											$('.mui-popup').find('.mui-popup-buttons').show();
											$('.mui-popup').eq(0).find('.mui-popup-buttons').hide();
										}
										var pay_pass = $(this).val();
										console.log(pay_pass);
										//执行其他操作 
										$.ajax({
											type: "post",
											url: "http://mall.itcn99.com/i/index/pay",
											async: true,
											dataType: 'jsonp',
											data: {
												"uid": b,
												"oid":oid,
												"pay_pass":pay_pass,
											},
											success: function(data) {
												console.log(data)
												var state = data.state;
												if(state == 0){
													mui.confirm("","支付密码错误，请重新输入",function(e){
														if(e.index == 1){
															window.location.href="forget_payment.html";
														}else if(e.index == 0){
															window.location.reload();
														}
													});
												}
												if(state == 1){
													mui.alert("","支付成功",function(){
															window.location.href="my_order.html";
													});
												}
												if(state == 2){
													mui.alert("","该订单已支付，请勿重复支付",function(){
														$('.mui-popup-buttons').hide();
														window.location.href="my_order.html";
													});
												}
												if(state == 3){
													mui.alert("","该订单已改变，请勿支付",function(){
														$('.mui-popup-buttons').hide();
														window.location.href="my_order.html";	
													});
												}
												if(state == 4){
													mui.alert("","余额不足，请充值",function(){
														$('.mui-popup-buttons').hide();
														window.location.href="my_order.html";
													});
												}
											}
										});

									}
								});
			}

	</script>
	
</html>